package com.cul;

import org.apache.poi.util.SystemOutLogger;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Test {
    public static void main(String[] args) {

        FileModify fileModify = new FileModify();
        try {
            fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql","SET FOREIGN_KEY_CHECKS=0;");
            fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", "DROP TABLE IF EXISTS `" + "out_oder" + "`;");
//            fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", "CREATE TABLE `" + "out_oder" + "` (");
//            fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", " `id` int(11) NOT NULL AUTO_INCREMENT,");
//            for (List<String> data : dataList) {
//                //字段名
//                fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", "  `" + data.get(0) + "`  ");
//                //字段类型
//                fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", data.get(1));
//
//                //是否非空
//                if ("TRUE".equals(data.get(2))) {
//                    fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", " NOT NULL ");
//                }
//                if (null != data.get(3) && data.get(3).length() > 0) {
//                    fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", data.get(3));
//                }
//                fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", " , ");
//            }
//            fileModify.fileAppender("C:\\Users\\12944\\Desktop\\建表\\运单指令.sql", " ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ");

        } catch (IOException e) {
            e.printStackTrace();
        }


        }
    }
